﻿<template>
  <div style="padding: 20px;">
    <h2>供应商数据测试</h2>
    <button @click="loadData">加载数据</button>
    <div v-if="loading">加载中...</div>
    <div v-else>
      <pre>{{ JSON.stringify(data, null, 2) }}</pre>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { apiGet } from '../../utils/api.js'

const loading = ref(false)
const data = ref(null)

async function loadData() {
  loading.value = true
  try {
    const result = await apiGet('/procure-service/supplier?pageNum=1&pageSize=10')
    data.value = result
    console.log('API响应:', result)
  } catch (error) {
    console.error('加载失败:', error)
    data.value = { error: error.message }
  } finally {
    loading.value = false
  }
}
</script>
